package com.itqf.service.impl;

import com.itqf.entity.TbItem;
import com.itqf.mapper.TbItemMapper;
import com.itqf.service.TbITemService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description:
 * @Company: 千锋互联
 * @Author: 李丽婷
 * @Date: 2020/11/11
 * @Time: 下午5:23
 */
@Service(value = "tbItemServiceImpl")  //applicationContext.xml  <bean id="tbItemServiceImpl" class="com.itqf.service.impl.TbItemServiceImpl">
//@Scope("prototype")
public class TbItemServiceImpl implements TbITemService {

   // @Autowired //默认按照类型注入
    @Resource  //默认按照名称注入tbItemMapper
    private TbItemMapper tbItemMapper ;

    @Value("${jdbc.driver}") //获取properties配置文件中的值并赋值给driverClass 变量
    //  xml文件  <property>
    private  String  driverClass;


    @Override
    public List<TbItem> findAll() {
        System.out.println("driverClass"+driverClass);
        return tbItemMapper.findAll();
    }
}
